﻿
using FreeSql;
using ExceptionDataStatisticsService.Service;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Msung.Core;
using Msung.Core.Caching;
using Msung.Core.Model;
using Msung.Repository.Entity;
using Msung.Repository.IRepository;
using Quartz;
using StackExchange.Redis;
using System;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Formats.Asn1.AsnWriter;

namespace IcIntegration.Job.Jobs
{
    public class IvJobService : IJob
    {
        private readonly ILogger _logger;
        private readonly IServiceProvider _serviceProvider;

        public IvJobService(
            IServiceProvider serviceProvider,
            ILogger<IvJobService> logger)
        {
            _logger = logger;
            _serviceProvider = serviceProvider;
        }

        public async Task Execute(IJobExecutionContext context)
        {
            Console.WriteLine("IvJobService:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            ExceptionDataService exceptionDataService = new ExceptionDataService(_serviceProvider, _logger);

            string[] equipmentList = new string[] { "1033", "1034", "1035", "1036", "1037", "1038", "1039", "1040", "1041", "1042", "1043", "1044", "1045", "1046", "1047", "1048", "1049", "1050", "1051", "1052", "1053", "1054", "1055", "1056", "3451", "3452", "3453", "3454", "3455", "3456", "3457", "3458", "3459", "3460" };
            exceptionDataService.ExceptionDataStatistics(this.GetType().Name, equipmentList);
        }
    }
}

